package com.course.android.activity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;

import androidx.activity.result.ActivityResultLauncher;

import com.course.android.activity.ac.BluetoothActivity;
import com.course.android.activity.ac.ConstraintLayoutActivity;
import com.course.android.activity.ac.GpsActivity;
import com.course.android.activity.ac.HomeActivity;
import com.course.android.activity.ac.HttpActivity;
import com.course.android.activity.ac.IntentActivity;
import com.course.android.activity.ac.LifeCycleActivity;
import com.course.android.activity.ac.LinearLayoutActivity;
import com.course.android.activity.ac.UploadImageAcivity;
import com.course.android.activity.ac.ViewActivity;
import com.course.android.activity.ac.WebviewActivity;

public class ActivityIntent {
    public static void toLifeCycle(ActivityResultLauncher launcher, Activity activity) {
        Intent intent = new Intent(activity, LifeCycleActivity.class);
//        intent.putExtra(ActivityIntentKey.REQ_CODE,101);// 如果不需要标记返回结果就不用使用
        launcher.launch(intent);

    }
    public static void toMain(ActivityResultLauncher launcher, Activity activity) {
        Intent intent = new Intent(activity, MainActivity.class);
//        intent.putExtra(ActivityIntentKey.REQ_CODE,101);// 如果不需要标记返回结果就不用使用
        launcher.launch(intent);

    }

    public static void toIntent(ActivityResultLauncher launcher, Activity activity) {
        Intent intent = new Intent(activity, IntentActivity.class);
        //        intent.putExtra(ActivityIntentKey.REQ_CODE,101);// 如果不需要标记返回结果就不用使用
        launcher.launch(intent);
    }
    public static void toConstraintIntent(ActivityResultLauncher launcher, Activity activity) {
        Intent intent = new Intent(activity, ConstraintLayoutActivity.class);
        //        intent.putExtra(ActivityIntentKey.REQ_CODE,101);// 如果不需要标记返回结果就不用使用
        launcher.launch(intent);
    } public static void toLinearlayoutIntent(ActivityResultLauncher launcher, Activity activity) {
        Intent intent = new Intent(activity, LinearLayoutActivity.class);
        //        intent.putExtra(ActivityIntentKey.REQ_CODE,101);// 如果不需要标记返回结果就不用使用
        launcher.launch(intent);
    }
    public static void toViewIntent(ActivityResultLauncher launcher, Activity activity) {
        Intent intent = new Intent(activity, ViewActivity.class);
        //        intent.putExtra(ActivityIntentKey.REQ_CODE,101);// 如果不需要标记返回结果就不用使用
        launcher.launch(intent);
    }
   public static void toWebViewIntent(Context activity, String title, String url) {
        Intent intent = new Intent(activity, WebviewActivity.class);
       intent.putExtra("title",title);
       intent.putExtra("url",url);
       activity.startActivity(intent);
    }

    public static void toHttpViewIntent(ActivityResultLauncher launcher, Activity activity) {
        Intent intent = new Intent(activity, HttpActivity.class);
        //        intent.putExtra(ActivityIntentKey.REQ_CODE,101);// 如果不需要标记返回结果就不用使用
        launcher.launch(intent);
    }

    public static void toHomeIntent(ActivityResultLauncher launcher, Activity activity) {
        Intent intent = new Intent(activity, HomeActivity.class);
        //        intent.putExtra(ActivityIntentKey.REQ_CODE,101);// 如果不需要标记返回结果就不用使用
        launcher.launch(intent);
    }

    public static void uploadImage(ActivityResultLauncher launcher, Activity activity) {
        Intent intent = new Intent(activity, UploadImageAcivity.class);
        //        intent.putExtra(ActivityIntentKey.REQ_CODE,101);// 如果不需要标记返回结果就不用使用
        launcher.launch(intent);
    }
    public static void toBluetoothViewIntent(ActivityResultLauncher launcher, Activity activity) {
        Intent intent = new Intent(activity, BluetoothActivity.class);
        //        intent.putExtra(ActivityIntentKey.REQ_CODE,101);// 如果不需要标记返回结果就不用使用
        launcher.launch(intent);
    }

    public static void toLoginsIntent(ActivityResultLauncher launcher, Activity activity) {
        Intent intent = new Intent(activity, LoginActivity.class);
        //        intent.putExtra(ActivityIntentKey.REQ_CODE,101);// 如果不需要标记返回结果就不用使用
        launcher.launch(intent);
    }

    public static void toLoginsIntent(Activity activity) {
        Intent intent = new Intent(activity, LoginActivity.class);
        //        intent.putExtra(ActivityIntentKey.REQ_CODE,101);// 如果不需要标记返回结果就不用使用
        activity.startActivity(intent);
    }


    public static void toVideoIntent(Activity activity) {
        Intent intent = new Intent(activity, CameraVideoActivity.class);
        //        intent.putExtra(ActivityIntentKey.REQ_CODE,101);// 如果不需要标记返回结果就不用使用
        activity.startActivity(intent);
    }

    public static void toGpsViewIntent(ActivityResultLauncher launcher, Activity activity) {
        Intent intent = new Intent(activity, GpsActivity.class);
        //        intent.putExtra(ActivityIntentKey.REQ_CODE,101);// 如果不需要标记返回结果就不用使用
        launcher.launch(intent);
    }


}
